import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
  selector: 'app-qianggou',
  templateUrl: './qianggou.component.html',
  styleUrls: ['./qianggou.component.css']
})

export class QianggouComponent implements OnInit {

  currentPage:number=1;
  numPages:number=0;
  curPageNum:number=1;
  constructor(private router : Router,private route: ActivatedRoute) { }
  pageChanged(ev){
    this
      .router
      .navigate( ['qianggou'],{queryParams:{pn:ev.page}});
  }
  ngOnInit() {
    this.route.queryParams.subscribe(x=>{
        this.currentPage=x.pn||1;
        this.curPageNum= parseInt(x.pn);
    });
  }

}
